package com.eastcompeace;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.eastcompeace.interceptor.AuthInterceptor;

/**
 * 继承WebMvcConfigurerAdapter，复写addInterceptors方法
 * 
 * @author Administrator
 * 
 */
@Configuration
public class WebAdapter implements WebMvcConfigurer {

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		// TODO Auto-generated method stub
		WebMvcConfigurer.super.addInterceptors(registry);
		
		registry.addInterceptor(new AuthInterceptor()).addPathPatterns("/**");
	}

}